System and method for estimating distributed consumption of a quota

ABSTRACT

Methods, systems, and apparatus, including computer programs encoded on a computer storage medium, for estimating distributed consumption of a quota. One of the methods includes receiving, by a first request processing server, a request having one or more specified characteristics; identifying a quota; determining, by the first request processing server, an actual number of requests having the one or more characteristics received by the first request processing server since a most recent synchronization with a parent server; generating, by the first request processing server, a current estimated total number of requests having the one or more characteristics that have been received; determining, by the first request processing server, that the quota has not been reached; and approving, by the first request processing server, the received request.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of and claims priority to U.S.application Ser. No. 15/224,424, filed on Jul. 29, 2016, which is acontinuation of PCT Application No. PCT/RU2015/000946, filed on Dec. 29,2015. The disclosures of the prior applications are considered part ofand are incorporated by reference in the disclosure of this application.

BACKGROUND

This disclosure relates to estimating a distributed consumption of aquota in a networked service provider system.

A service provider system can receive requests from third parties to usea service of the system and can process the requests to provide theservice. The system can impose a quota on how many requests areprocessed. The quota can apply to requests having certaincharacteristics. The characteristics, such as an identifier of a senderof a request, can be established by the system.

By way of illustration, a service provider system can implement anapplication programming interface (API), with which third parties, e.g.,software developers, can interface. Third parties can utilize servicesof the system through the API. To communicate with the API, developerssend requests with API keys and the service provider system can trackand control how the API is being used based on the API key. To preventabuse, the service provider system can have a quota of a number of timeseach API key can access the API. For example, the quota can be a totalfixed number or a fixed number over a period of time.

SUMMARY

In general, one innovative aspect of the subject matter described inthis disclosure can be embodied in methods that include the actions ofreceiving, by a first request processing server of a plurality ofrequest processing servers, a request having one or more specifiedcharacteristics; identifying a quota that specifies a maximum totalnumber of requests that have the one or more specified characteristicsthat can be approved by all of the plurality of request processingservers; determining, by the first request processing server, an actualnumber of requests having the one or more characteristics received bythe first request processing server since a most recent synchronizationwith a parent server to obtain a first snapshot identifying a number ofrequests having the one or more characteristics that have been receivedby all of the plurality of request processing servers; generating, bythe first request processing server, a current estimated total number ofrequests having the one or more characteristics that have been receivedby all of the plurality of request processing servers based at least onthe actual number of requests received by the first request processingserver; determining, by the first request processing server, that thequota has not been reached based at least on the current estimatedtotal; and approving, by the first request processing server, thereceived request.

Other implementations of this and other aspects include correspondingsystems, apparatus, and computer programs, configured to perform theactions of the methods, encoded on computer storage devices. A system ofone or more computers can be so configured by virtue of software,firmware, hardware, or a combination of them installed on the systemthat in operation cause the system to perform the actions. One or morecomputer programs can be so configured by virtue of having instructionsthat, when executed by data processing apparatus, cause the apparatus toperform the actions.

The foregoing and other embodiments can each optionally include one ormore of the following features, alone or in combination.

The actions can further include receiving, by the first requestprocessing server, a second request having the one or more specifiedcharacteristics; generating, by the first request processing server, asecond current estimated total number of requests having the one or morecharacteristics that have been received by all of the plurality ofrequest processing servers since the most recent synchronization basedat least on the actual number of requests received by the first requestprocessing server; determining, by the first request processing server,that the quota has been reached based at least on the second currentestimated total; and rejecting, by the first request processing server,the received request.

The parent server may a number of times all of the plurality of requestprocessing servers have received requests having the one or morecharacteristics, and wherein each of the other request processingservers synchronize with the parent server to provide the parent serverwith a respective number of times the request processing server hasreceived requests having the one or more characteristics.

Generating, by the first request processing server, a current estimatedtotal number of requests can be based on a fill factor that is a ratioof a first rate at which the other request processing servers arereceiving requests having the one or more characteristics to a secondrate at which the first request processing server is receiving requestshaving the one or more characteristics.

The actions can further include updating the fill factor, the updatingcomprising: determining whether the fill factor is increasing ordecreasing; if the fill factor is increasing, updating the fill factoraccording to a first function; and if the fill factor is decreasing,updating the fill factor according to a second function. The firstfunction may be: y=(1−sin⁶(x/2))*0.5*x, wherein x is the fill factor andy is the updated fill factor. The second function may be:y=(sin⁴(x/2)*0.5+0.01)*x, wherein x is the fill factor and y is theupdated fill factor.

Synchronization may occur more frequently as the current estimated totalnumber of requests approaches the quota.

The one or more characteristics may specify an application identifier, agroup identifier, and an external identifier, and wherein each uniquecombination of the application identifier, the group identifier, and theexternal identifier corresponds to a respective quota.

The details of one or more embodiments of the subject matter describedin this disclosure are set forth in the accompanying drawings and thedescription below. Other features, aspects, and advantages of thesubject matter will become apparent from the description, the drawings,and the claims.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 shows an example system for estimating distributed consumption ofa quota.

FIG. 2 is a flow diagram of an example process for estimatingdistributed consumption of a quota.

FIG. 3 is a flow diagram of an example process for updating a fillfactor.

FIG. 4 is a block diagram of an example of a telephony applicationplatform.

Like reference numbers and designations in the various drawings indicatelike elements.

DETAILED DESCRIPTION

The present disclosure generally describes techniques for estimatingdistributed consumption of a quota in service provider systems,including software platforms. The service provider system receivesrequests from third party applications, such as developer applications,to use a service of the system and processes the requests to provide theservice. The system imposes a quota on how many requests are processed.In some embodiments, the system applies different quota amounts torequests having different characteristics. That is, the system maintainsmultiple different quotas, with each quota applying to requests having adifferent set of characteristics or parameters.

In particular, the service provider system can implement an API fordeveloper access with a quota for each request having one or morespecified characteristics, e.g., for each developer application ordeveloper application request type. Requests to the API can bedistributed to one or more of multiple request processing servers in theservice provider system. Each request processing server can estimate howmuch of the quota has been consumed by the developer application acrossall of the request processing servers despite not being in real-timecommunication with the other request processing servers, and can approveor reject requests to the API based on the estimation.

Particular embodiments of the subject matter described in thisdisclosure can be implemented so as to realize one or more of thefollowing advantages. Overconsumption of the quota can be prevented whenthe quota is tracked across multiple request processing servers. Inparticular, a near-actual estimation of the quota can be computedwithout requiring expending significant resources of having requestprocessing servers in a service provider system be in real-timecommunication with each other.

FIG. 1 shows an example system 100 for estimating distributedconsumption of a quota. The system 100 can be implemented as computerprograms on one or more computers, e.g. servers, routers, gateways, orthe like network equipment, in one or more locations, in which thesystems, components, and techniques described herein can be implemented.

The system 100 provides services to users of the system 100 through anAPI. The API allows developer applications to access functions orservices of the system 100. In some examples, the system 100 may be ahosted private branch exchange (PBX) system that provides PBX servicesthat include voice-over-Internet-Protocol (VOIP) telephony services todeveloper applications using the system through the API. The servicesprovided by the system 100 can also include other kinds of communicationinstead of or in addition to VOIP telephony services. For example, thecommunication services provided by the communication service providersystem 100 can also include one or more of: short message service (SMS)messaging, faxing, instant messaging, video conferencing, e-mail, and soon.

Developers using the system 100 can deploy an application 102 on one ormore computers 120-124 in a developer system 118 maintained by thedevelopers. Each computer can include a memory, e.g., a random accessmemory (RAM), for storing instructions and data and a processor forexecuting stored instructions. The memory can include both read only andwritable memory. The computers can include electronic devices, forexample mobile devices (smartphones, tablet computers, etc.), landlinephones (plain old telephone service (POTS) phones or voice-over-InternetProtocol (VOIP) softphones), personal computers, network equipment(servers, routers, gateways, etc.), audio or video conferencingconsoles, audio or video conferencing servers, and facsimile (fax)machines. The computers 120-124 on which the developer application 102is deployed can communicate with the system 100 over a network 104.

The network 104 may be a wired or wireless network, e.g., a local areanetwork (LAN), a wide area network (WAN), or a combination of the two.Though not illustrated, requests from electronic devices intended forthe system 100 can be routed through other provider networks (cellularnetworks, PSTN, wireless networks, etc.) before reaching the network104.

The system 100 can process requests from multiple developer applicationsusing multiple request processing servers 108-114. When processing arequest, e.g., from the developer application 102, the system 100receives the request at a load balancer 106. The load balancer 106 isone or more one or more computer programs executing one or morecomputers that redirect the request to one of the request processingservers 108-114 using conventional load balancing techniques, e.g.,random choice, round robin, lightest load, and so on.

In some embodiments, it may be desirable to enforce a quota of a numberof API requests from the developer application 102. In particular, thesystem 100 can approve requests for processing until the quota is met,after which the system 100 can reject requests for processing.

There can be different types of quotas. One type of quota specifies anumber of requests over a period of time, e.g., per week, per month, orper minute. Another type of quota specifies a maximum number for aparticular type of request over all time. For example, the system 100can establish a maximum number of requests submitted by a unique one ofthe computers 120-124 to the system 100, e.g., before a user of theunique computer has to register with the system 100. After receiving andprocessing the maximum number of these requests from the computer, thesystem 100 can reject all subsequent requests from the computer, e.g.,and provide a registration interface for presentation on the computer.

Each request processing server 108-114 can maintain a counter of thenumber of requests that have been processed by the request processingserver to track whether the developer application 102 has exceeded thequota. Generally, a request processing server does not have real-timeaccess to the counters of other request processing servers. Thus, thesystem 100 includes a parent server 116 to which each request processingserver 108-114 periodically synchronizes. Synchronizing will bedescribed further below with reference to FIG. 3. The parent server 116stores a “snapshot”, e.g., in an internal memory, of a total number ofrequests that have been processed by all of the request processingservers 108-114, and sends the “snapshot” to each of the requestprocessing servers 108-114 during synchronization. The requestprocessing servers 108-114 can use the “snapshot” to, when a new requestis received, estimate whether the quota has been exceeded. This will bedescribed below with reference to FIG. 2.

While FIG. 1 describes requests to the system 100 as API requests from adeveloper application 102, in some embodiments the requests are non-APIrequests to the system from various devices. For example, a quota canlimit a number of requests that have characteristics that identify aparticular resource of the system 100.

FIG. 2 is a flow diagram of an example process 200 for estimatingdistributed consumption of a quota. The process 200 can be performed bya request processing server, e.g., request processing server 108 of FIG.1, in a system of multiple request processing servers.

At step 202, a request having one or more specified characteristics isreceived by the request processing server. The characteristics canspecify an application identifier, a group identifier, an externalidentifier, or any combination thereof. The application identifier is anidentifier for a third party developer application. For example, theapplication identifier may be an API key that is assigned to aparticular third party develop application for use in communicating withan API implemented by the system. As a particular example, the thirdparty developer application may be a third party telephony or othercommunication service application that makes use of telephony or othercommunication services offered by the system by submitting requests toan API implemented by the system using a particular API key. The groupand external identifiers can be identifiers used to further identifycharacteristics of the developer application.

In some example embodiments, each application identifier corresponds toa respective quota. For example, one application identifier can have aquota of one million requests per month while another applicationidentifier can have a quota of twenty thousand requests per month. Thequotas may be specified by a system administrator or other user of thesystem. In some embodiments, the application identifier is associatedwith a particular account type, e.g., a paid account, which is assigneda respective quota by the system. In some other embodiments, each uniquecombination of identifiers corresponds to a respective quota.

At step 204, a quota that specifies a maximum total number of requestshaving the one or more specified characteristics that can be approved byall of the multiple request processing servers in the system isidentified.

At step 206, an actual number of requests having the one or morecharacteristics is determined. In particular, the actual number ofrequests is a number of requests processed by the request processingserver since a most recent synchronization with the parent server.Synchronization provides the request processing server with dataspecifying how many requests have been approved by all of the requestprocessing servers as of the time of the synchronization.Synchronization will be described further below with reference to FIG.3. In some embodiments, the request processing server synchronizes withthe parent server more frequently as the actual number of requestsapproaches the quota. For example, the request processing server cansynchronize with the parent server when 25%, 50%, 75%, 85%, 90%, 95%,98%, and 100% of the quota is consumed. As another example, the requestprocessing server can synchronize with the parent server at specifiedtime intervals, with the time intervals getting shorter as the actualnumber of requests approaches the quota. As yet another example, therequest processing server can synchronize with the parent server bothwhen a certain percentage of the quota is consumed and at specified timeintervals.

Upon receiving the requests having the one or more characteristics, therequest processing server can track the requests in an internal memory.That is, the actual number of requests having the one or morecharacteristics can be incremented upon the request processing serverreceiving another request having the one or more characteristics.

At step 208, a current estimated total number of requests having the oneor more characteristics that have been received by all of the requestprocessing servers in the system is generated. The current estimatedtotal number of requests can be generated from a fill factor. The fillfactor is an estimate of how a first rate at which all of the requestprocessing servers in the system are receiving requests compares to asecond rate at which the request processing server is receivingrequests. In some implementations, the estimate is a determination of aquotient of the first rate and the second rate. The fill factor can bedetermined by comparing the number of requests that have been receivedby all of the request processing servers received duringsynchronizations with the actual number of requests received by therequest processing server. In some embodiments, the fill factor isupdated during every synchronization, and each request processing servermaintains a respective fill factor. In some embodiments, the fill factorstarts at zero. Examples of updating the fill factor will be describedfurther below with reference to FIG. 3.

In some embodiments, the current estimated total number of requests isgenerated from the actual number of requests received by the requestprocessing server and an estimated number of requests received by theother request processing servers. The estimated number of requestsreceived by the other request processing servers can be computed from afunction of the actual number of requests and the fill factor. In someembodiments, the function is a multiplication function. By way ofillustration, the current estimated total number of requests can be asum or a weighted sum of the actual number of requests received sincethe most recent synchronization and the estimated number of requestsreceived at the other request processing servers.

After the current estimated total is generated, a comparison between thecurrent estimated total and the quota can be performed. That is, adetermination is made as to whether or not to approve the request basedon whether the current estimated total is less than the quota. If thecurrent estimated total is less than the quota, i.e., step 210, therequest processing server can approve the request. If the currentestimated total is equal to or greater than the quota, the requestprocessing server can reject the request.

At step 212, the received request is approved in response to thedetermination that the current estimated total is less than the quota.Upon approval, the request is processed by the request processing serverand a portion of the quota is consumed. The request processing servercan track the number of received requests that have been processed. Ifthe request processing server receives a subsequent request anddetermines that the estimated total for the quota has been reached, therequest processing server rejects the received request.

In some embodiments, after synchronization with the parent requestprocessing servers, the request processing server has been determined tohave approved more requests than the quota allows. This can bedetermined by the request processing server or the parent server. Whenthis determination occurs, the request processing server is assigned adebt value. The debt value can be a difference between the total numberof approved requests and the quota. When the request processing serverreceives a new quota or the consumed quota is reset, the requestprocessing server can reject a number of requests equal to the debtvalue. Alternatively, the request processing server can initialize itscounter of requests received to the debt value on a subsequent cycle ofquota consumption, i.e., when the quota consumed is reset for a nexttime period. This enables the request processing server to make up forthe extra quota consumed on a previous cycle of quota consumption.

In some embodiments, request processing servers are grouped in tiers toscale a large number of requests at the system. For example, the firsttier of request processing servers can be request processing servers108-114 of FIG. 1 and the parent server 116 can be a request processingserver in a second tier of request processing servers. The requestprocessing servers in the second tier of request processing servers,i.e., the parent server 116, can receive requests, but also can act as aparent server to, i.e., synchronize with, the request processing servers108-114. The second tier of request processing servers can thensynchronize with a parent server, which keeps track of a total count ofall approved requests across the request processing servers. In someembodiments, more than two tiers of request processing servers are usedto even further distribute a large of requests processed by the system.

FIG. 3 is a flow diagram of an example process 300 for updating a fillfactor. The process 300 can be performed by a request processing server,e.g., request processing server 108 of FIG. 1, in a system of multipleservers.

At step 302, a parent server, e.g., parent server 116 of FIG. 1, issynchronized with the request processing server. As discussed above, thesynchronization can occur periodically. The other request processingservers in the system also periodically synchronize with the parentserver. During synchronization with any particular request processingserver, the request processing server sends the actual number ofrequests processed by the request processing server since the mostrecent synchronization to the parent server and the parent server sendsa snapshot to the particular request processing server. The snapshot canidentify a number of requests having the one or more characteristicsthat have been received by all of the request processing servers in thesystem. Therefore, after synchronization, the particular requestprocessing server has data specifying a total number of requests havingthe one or more characteristics that have been approved at all of therequest processing servers across the entire system since the quota wasinitiated.

In some embodiments, the parent server is initialized from a firstsynchronization from any of the multiple request processing servers inthe system. That is, the parent server replicates a state of the requestprocessing server at the first synchronization and stores the state inan internal memory. The state includes data specifying the number ofrequests received by the request processing server. Upon furthersynchronizations from any request processing server, the parent serverupdates the state in the internal memory.

After each synchronization, the request processing server can update afill factor, which is used to generate a current estimated total. Thecurrent estimated total is compared to the quota, the result of whichdetermines whether a request is approved or rejected, as describedabove.

At step 304, the fill factor is determined to be increasing ordecreasing. To determine the fill factor, a ratio of a first rate atwhich all of the request processing servers are receiving requestshaving the one or more characteristics to a second rate at which therequest processing server is receiving requests having the one or morecharacteristics is determined. The fill factor is determined to beincreasing when the ratio is higher than the current fill factor and thefill factor is determined to be decreasing if the ratio is lower thanthe current fill factor.

If the fill factor is increasing, the fill factor can be updatedaccording to a first function at step 306. If the fill factor isdecreasing, a fill factor can be updated according to a second functionat step 308. The first function can be a function that causes the fillfactor to increase quickly while small and increase more slowly whilelarge. The second function can cause the fill factor to decrease quicklywhile large and decrease slowly while small. The two functions can bedifferent to slow adjustment of the fill factor over time, whichensures, based on respective current estimated total number of requests,no one request processing server in the system rejects most requestswhile another request processing server in the system accepts mostrequests.

An example of the first function is as follows:

y=(1−sin⁶(x/2))*0.5*x

where x is the fill factor and y is the updated fill factor.

An example of the second function is as follows:

y=(sin⁴(x/2)*0.5+0.01)*x

where x is the fill factor and y is the updated fill factor.

FIG. 4 is a simplified block diagram of an example of a PBX platform 400(such as system 100 of FIG. 1) employing techniques as described herein.PBX platform 400 provides telephony services that allow communicationamong its users, and between its users and users associated with avariety of external telephony platforms 402 via telecommunication APIs404 and 406, Outbound SIP Proxy 408, and Inbound SIP Router 410. MediaServers 409 and Fax Servers 411 provide functionality for processingvoice over IP and fax over IP data, respectively. Telco API 404 is astateless low-level API that provides signaling and media telephonyprimitives including, for example, call answering, placing of outboundcalls, creation of conference call objects, addition of calls toconference call objects, playback of media for active calls, recordingof active calls, etc. Telco API 406 is a higher-level API that has moresophisticated functionality such as, for example, interactive voiceresponse (IVR), call forwarding, voice mail, etc. In the depictedimplementations, telco API 406 doesn't have access to the PBX platformsdatabases, but maintains session context data 412 to support itsfunctionality. Telco API 406 may include function primitives which canbe used to support the development of telephony applications asdescribed herein.

Outbound SIP Proxy 408, and Inbound SIP Router 310 employ the SessionInitiation Protocol (SIP), an IETF-defined signaling protocol widelyused for controlling communication sessions such as voice and videocalls over the Internet Protocol (IP). SIP can be used for creating,modifying and terminating two-party (unicast) or multiparty (multicast)sessions, and may be one of the core protocols employed by systemsconfigured as shown in and described above with reference to FIG. 1. Thelatest version of the SIP specification is RFC 3261 from the IETFNetwork Working Group published in June 2002, the entirety of which isincorporated herein by reference for all purposes.

The core functionality of PBX platform 400 (e.g., as described abovewith reference to FIG. 1) is accessed via telephony services block 414which has access (not entirely shown for clarity) to the various datarepositories of PBX platform 400, i.e., account DB 416, sessions DB 418,call log DB, 420 and message DB 422. Telephony services block 414receives commands from telephony applications 424 and controls executionof the commands on the PBX platform 400.

In particular, the telephony services block 414 may include multiplerequest processing servers (such as the request processing servers108-114) that receive requests, e.g., commands, from the telephonyapplications and control the execution of the commands on the PBXplatform 400. As described above, the multiple request processingservers can each receive requests from the telephony applications 424,determine whether to approve or deny the request and, if approved,process the request.

Telephony services block 414 may also include internal telephonyapplications 425 that are hosted and/or developed on or in connectionwith PBX platform 400. The depicted implementation also includes variousAPIs that allow external telephony applications 424 to interact with PBXplatform 400 as described herein. The APIs associated with PBX platform400 allow telephony applications 424 and 425 to integrate with basicfunctionality of PBX platform 400 at multiple integration points, tocontrol call flows during execution of the call flows by the platform(e.g., via API 426), and to access platform data (e.g., in DBs 416-422via APIs 428-434).

For example, the telephony applications may relate to a particularenterprise and might be integrated into call flows for that enterpriseat the point where a call is made or received (e.g., enforcing blockednumbers), the company greeting level (e.g., company directory), thedepartment level (e.g., call distribution), or at the individual level(e.g., call handling for individual extensions). And for eachintegration point, such applications can provide additional options,replace existing options, or augment existing options of the PBXplatform functionality. In addition, the script that embodies suchoptions can be hosted externally to the PBX platform, and hand controlof call flows back and forth with the platform.

As another example, a script may be created to make calls and playnotifications to customers, such as notifications that customer contactinformation has been changed. A script may also be created to execute asa call is received to determine whether the caller is on a user'sdynamic list of blocked numbers, and if so, to terminate the call. Ascript may be created to execute at the company greeting level to playdynamic customer alerts that are hosted on a user's own system and notthe PBX platform, such as customer-specific messages (e.g., based oncaller ID), holiday alerts, or dynamic advertisements. Other scripts maybe created at the company greeting level to enable a customized companydirectory, such as a company directory that uses natural languageprocessing to determine the correct department or individual to answerthe call (e.g., “How may I help you?” prompt) or a multiple levelinteractive voice response (“IVR”) menu. A script may be created toexecute at the department level to implement customized rules fordistributing calls, such as company-specific rules for selectingcustomer service agents from a queue. A script may be created to executeat the individual level to implement customized greetings, such as anunavailability greeting based on the individual's calendar or otherpresence information, or to implement customized call screening orvoicemail dialogs. The foregoing examples serve to illustrate the greatdiversity of telephony functionality that may be provided according tothe techniques describe herein.

A telephony application script may return control of a call flow back tothe application that called the script, such as the default applicationprovided by the PBX platform or a script that called the current script,either after the current script has executed or at any point in thecurrent script, such as upon the occurrence of a condition defined inthe current script. In some implementations, part or all of the defaultapplication provided by the PBX platform may be exposed as a script toallow for a large number of integration points and flexiblecustomization of the PBX platform.

According to a particular class of implementations, APIs having thefunctionalities described herein are implemented using the JavaScriptObject Notation (JSON) data format described in RFC 4627 dated July2006, the entirety of which is incorporated herein by reference for allpurposes. This class of implementations is also implemented inaccordance with at least some of the guiding principles embodied by theREST (REpresentational State Transfer) computing paradigm. The currentlyevolving notion of a “RESTful” system is based on the doctoraldissertation of Roy Thomas Fielding entitled Architectural Styles andthe Design of Network-based Software Architectures, University ofCalifornia, Irvine (2000), the entirety of which is incorporated hereinby reference for all purposes. Although there is, as of yet, no ratifiedstandard, a RESTful system generally observes a set of principles thatdefine how Web standards such as HTTP and URLs may be used to facilitateheterogeneous application-to-application communication. Generallyspeaking, REST relates to resource-based systems in which URLs refer tothe resources and HTTP methods are used to manipulate these resources.For additional information on RESTful systems, please refer to A BriefIntroduction to REST posted by Stefan Tilkov on infoq.com on Dec. 10,2007, the entirety of which is incorporated herein by reference for allpurposes.

According to a specific class of implementations, the APIs definespecific sets of responses for an application's various softwarecomponents to the HTTP methods. That is, the APIs define sets of rulesfor how they and the various software components with which theyinteract operate on the contents of a query for each of the differentmethods. According to a particular implementation, the HTTP methodsinclude the following:

“call”—Dial specified telephone number or SIP address

“conference”—Initiate or connect to specified conference

“end”—End current call

“if”—Define a condition (e.g., response, DTMF tone) to execute set ofcommands or script

“info”—Return session information (e.g., voice/fax/text, caller/accountID(s), to/from phone number(s), SIP address(es))

“play”—Play specified recording or phrase

“prompt”—Play specified recording or phrase and receive response

“record”—Record one or more channels of current call

“receive”—Initiate the receiving of fax, text, or other message dataover current call

“redirect”—Redirect incoming call to company, department, or individualuser (e.g., using name, phone number, extension, or SIP address)

“reject”—Reject incoming call

“result”—Return result of previous command (e.g., response to prompt,success/failure of command)

“script”—Run specified script

“send”—Send fax, text, or other message data over current call

“return”—Return control of call flow back to default or previousapplication

“transfer”—Transfer current call to company, department, or individualuser (e.g., using name, phone number, extension, or SIP address)

“wait”—Wait a specified period of time before continuing execution ofcall flow

It will be understood that a wide range of other HTTP methods may becreated or used, and that the foregoing list of HTTP methods shouldtherefore not be used to limit the scope of the present invention

Telephony applications 424 and 425 may provide a wide range of simple tohighly complex functionality that enhances, augments, or replaces thefunctionality provided by PBX platform 400. Examples of areas offunctionality include, but are not limited to, interactive voiceresponse functionality, call center functionality, call statisticsfunctionality, voice mail functionality, call blocking functionality,etc. In some implementations, media processing may be performed byservers hosted by telephony application developer and not PBX platform400, for example, to perform customized automatic speech recognition ornatural language processing for calls, after which control may be passedback to PBX platform 400, Virtually any telephony functionality that canbe imagined by developers and integrated with a PBX platform may besupported.

As mentioned above, telephony applications 425 may be developed and/orhosted on PBX platform 400. For example, platform 400 may include anapplication developer environment (not shown) in which developers (whomay be agents of, the platform provider, existing platform customers, orindependent developers) design and deploy telephony applications.Alternatively, telephony applications 424 may be developed and/or hostedon other platforms independent of PBX platform 400. PBX platform 400 mayalso include a telephony application store (not shown) in whichtelephony applications (e.g., 424 and/or 425) are made available forpurchase to customers of PBX platform 400.

According to some implementations, the telephony application store canoffer advanced billing and analytics functionality based on thetelephony applications' integration with PBX platform 400. Whiletraditional application stores provide fixed billing based on apurchased application, the telephony application store may providealternative billing based on the purchasers of telephony applicationswho may also be PBX platform subscribers. For example, the telephonyapplication store may provide subscription billing corresponding tosubscription billing for PBX platform 400, customized billing based onthe number of individuals (e.g., employees of an enterprise customer)under a user account (e.g., a company account) or the number oftelephone numbers under a user account, or usage billing based on usageof the telephony application or PBX platform 400 (e.g., number ofcallers, minutes used, storage used). In addition, because the telephonyapplications may be based on API calls processed by the PBX platform, atelephony application store integrated with PBX platform 400 can offeradvanced analytics detailing usage of the telephony applications, suchas call flow statistics and caller statistics.

Embodiments of the subject matter and the operations described in thisdisclosure can be implemented in digital electronic circuitry, or incomputer software, firmware, or hardware, including the structuresdisclosed in this disclosure and their structural equivalents, or incombinations of one or more of them. Embodiments of the subject matterdescribed in this disclosure can be implemented as one or more computerprograms, i.e., one or more modules of computer program instructions,encoded on computer storage medium for execution by, or to control theoperation of, data processing apparatus. Alternatively or in addition,the program instructions can be encoded on an artificially-generatedpropagated signal, e.g., a machine-generated electrical, optical, orelectromagnetic signal, that is generated to encode information fortransmission to suitable receiver apparatus for execution by a dataprocessing apparatus. A computer storage medium can be, or be includedin, a computer-readable storage device, a computer-readable storagesubstrate, a random or serial access memory array or device, or acombination of one or more of them. Moreover, while a computer storagemedium is not a propagated signal, a computer storage medium can be asource or destination of computer program instructions encoded in anartificially-generated propagated signal. The computer storage mediumcan also be, or be included in, one or more separate physical componentsor media.

The operations described in this disclosure can be implemented asoperations performed by a data processing apparatus on data stored onone or more computer-readable storage devices or received from othersources. The term “data processing apparatus” encompasses all kinds ofapparatus, devices, and machines for processing data, including by wayof example a programmable processor, a computer, a system on a chip, ormultiple ones, or combinations, of the foregoing. The apparatus can alsoinclude, in addition to hardware, code that creates an executionenvironment for the computer program in question, e.g., code thatconstitutes processor firmware, a protocol stack, a database managementsystem, an operating system, a cross-platform runtime environment, avirtual machine, or a combination of one or more of them. The apparatusand execution environment can realize various different computing modelinfrastructures, e.g., web services, distributed computing and gridcomputing infrastructures.

A computer program (also known as a program, software, softwareapplication, script, or code) can be written in any form of programminglanguage, including compiled or interpreted languages, declarative orprocedural languages, and it can be deployed in any form, including as astand-alone program or as a module, component, subroutine, object, orother unit suitable for use in a computing environment. A computerprogram may, but need not, correspond to a file in a file system. Aprogram can be stored in a portion of a file that holds other programsor data, e.g., one or more scripts stored in a markup language document,in a single file dedicated to the program in question, or in multiplecoordinated files, e.g., files that store one or more modules,sub-programs, or portions of code. A computer program can be deployed tobe executed on one computer or on multiple computers that are located atone site or distributed across multiple sites and interconnected by acommunication network.

The processes and logic flows described in this disclosure can beperformed by one or more programmable processors executing one or morecomputer programs to perform actions by operating on input data andgenerating output. Processors suitable for the execution of a computerprogram include, by way of example, both general and special purposemicroprocessors, and any one or more processors of any kind of digitalcomputer. Generally, a processor will receive instructions and data froma read-only memory or a random access memory or both. The essentialelements of a computer are a processor for performing actions inaccordance with instructions and one or more memory devices for storinginstructions and data. Generally, a computer will also include, or beoperatively coupled to receive data from or transfer data to, or both,one or more mass storage devices for storing data. However, a computerneed not have such devices. Moreover, a computer can be embedded inanother device, e.g., a mobile telephone, a smart phone, a mobile audioor video player, a game console, a Global Positioning System (GPS)receiver, and a wearable computer device, to name just a few. Devicessuitable for storing computer program instructions and data include allforms of non-volatile memory, media and memory devices, including by wayof example semiconductor memory devices, magnetic disks, and the like.The processor and the memory can be supplemented by, or incorporated in,special purpose logic circuitry.

To provide for interaction with a user, embodiments of the subjectmatter described in this disclosure can be implemented on a computerhaving a display device for displaying information to the user and akeyboard and a pointing device, e.g., a mouse or a trackball, by whichthe user can provide input to the computer. Other kinds of devices canbe used to provide for interaction with a user as well; for example,feedback provided to the user can be any form of sensory feedback, e.g.,visual feedback, auditory feedback, or tactile feedback; and input fromthe user can be received in any form, including acoustic, speech, ortactile input and output.

While this disclosure contains many specific implementation details,these should not be construed as limitations on the scope of the presentdisclosure or of what may be claimed, but rather as descriptions offeatures specific to particular embodiments of the present disclosure.Certain features that are described in this disclosure in the context ofseparate embodiments can also be implemented in combination in a singleembodiment. Conversely, various features that are described in thecontext of a single embodiment can also be implemented in multipleembodiments separately or in any suitable subcombination. Moreover,although features may be described above as acting in certaincombinations and even initially claimed as such, one or more featuresfrom a claimed combination can in some cases be excised from thecombination, and the claimed combination may be directed to asubcombination or variation of a subcombination.

Similarly, while operations are depicted in the drawings in a particularorder, this should not be understood as requiring that such operationsbe performed in the particular order shown or in sequential order, orthat all illustrated operations be performed, to achieve desirableresults. In certain circumstances, multitasking and parallel processingmay be advantageous. Moreover, the separation of various systemcomponents in the embodiments described above should not be understoodas requiring such separation in all embodiments, and it should beunderstood that the described program components and systems cangenerally be integrated together in a single software product orpackaged into multiple software products.

Thus, particular embodiments of the subject matter have been described.Other embodiments are within the scope of the following claims. In somecases, the actions recited in the claims can be performed in a differentorder and still achieve desirable results. In addition, the processesdepicted in the accompanying figures do not necessarily require theparticular order shown, or sequential order, to achieve desirableresults. In certain implementations, multitasking and parallelprocessing may be advantageous.

What is claimed is:
 1. A method implemented by a request processingserver, the method comprising: receiving a first request having one ormore specified characteristics; identifying a quota that specifies amaximum total number of requests that have the one or more specifiedcharacteristics that can be approved by all of a plurality of requestprocessing servers; generating a first current estimated total number ofrequests having the one or more characteristics that have been receivedby all of the plurality of request processing servers based at least onan actual number of requests received by the request processing serversince a most recent synchronization with a parent server; and approvingthe first received request upon determining that the quota has not beenreached based at least on the first current estimated total.
 2. Themethod of claim 1, further comprising: receiving a second request havingthe one or more specified characteristics; generating a second currentestimated total number of requests having the one or morecharacteristics that have been received by all of the plurality ofrequest processing servers since the most recent synchronization basedat least on the actual number of requests received by the requestprocessing server; and rejecting the second received request upondetermining that the quota has been reached based at least on the secondcurrent estimated total.
 3. The method of claim 1, wherein the parentserver stores a number of times all of the plurality of requestprocessing servers have received requests having the one or morecharacteristics, and wherein other request processing serverssynchronize with the parent server to provide the parent server with arespective number of times each of the other request processing serverhas received requests having the one or more characteristics.
 4. Themethod of claim 1, wherein generating the first current estimated totalnumber of requests is based on a fill factor that is a ratio of a firstrate at which other request processing servers are receiving requestshaving the one or more characteristics to a second rate at which therequest processing server is receiving requests having the one or morecharacteristics.
 5. The method of claim 4, further comprising:determining whether the fill factor is increasing or decreasing; if thefill factor is increasing, updating the fill factor according to a firstfunction; and if the fill factor is decreasing, updating the fill factoraccording to a second function.
 6. The method of claim 1, whereinsynchronization occurs more frequently as the current estimated totalnumber of requests approaches the quota.
 7. The method of claim 1,wherein the one or more characteristics specify an applicationidentifier, a group identifier, and an external identifier, and whereineach unique combination of the application identifier, the groupidentifier, and the external identifier corresponds to a respectivequota.
 8. A system comprising: a plurality of request processingservers, wherein each of the plurality of request processing servers isconfigured to perform operations comprising: receiving a first requesthaving one or more specified characteristics; identifying a quota thatspecifies a maximum total number of requests that have the one or morespecified characteristics that can be approved by all of the pluralityof request processing servers; generating a first current estimatedtotal number of requests having the one or more characteristics thathave been received by all of the plurality of request processing serversbased at least on an actual number of requests received by the requestprocessing server since a most recent synchronization with a parentserver; and approving the first received request upon determining thatthe quota has not been reached based at least on the first currentestimated total.
 9. The system of claim 8, the operations furthercomprising: receiving a second request having the one or more specifiedcharacteristics; generating a second current estimated total number ofrequests having the one or more characteristics that have been receivedby all of the plurality of request processing servers since the mostrecent synchronization based at least on the actual number of requestsreceived by the request processing server; and rejecting the secondreceived request upon determining that the quota has been reached basedat least on the second current estimated total.
 10. The system of claim8, further comprising: the parent server, wherein the parent serverstores a number of times all of the plurality of request processingservers have received requests having the one or more characteristics,and wherein other request processing servers synchronize with the parentserver to provide the parent server with a respective number of timeseach of the other request processing server has received requests havingthe one or more characteristics.
 11. The system of claim 8, whereingenerating the first current estimated total number of requests is basedon a fill factor that is a ratio of a first rate at which other requestprocessing servers are receiving requests having the one or morecharacteristics to a second rate at which the request processing serveris receiving requests having the one or more characteristics.
 12. Thesystem of claim 11, the operations further comprising: determiningwhether the fill factor is increasing or decreasing; if the fill factoris increasing, updating the fill factor according to a first function;and if the fill factor is decreasing, updating the fill factor accordingto a second function.
 13. The system of claim 8, wherein synchronizationoccurs more frequently as the current estimated total number of requestsapproaches the quota.
 14. The system of claim 8, wherein the one or morecharacteristics specify an application identifier, a group identifier,and an external identifier, and wherein each unique combination of theapplication identifier, the group identifier, and the externalidentifier corresponds to a respective quota.
 15. One or morenon-transitory, computer-readable storage media storing instructionsthat, when executed by one or more processors, cause the one or moreprocessors to perform operations comprising: receiving a first requesthaving one or more specified characteristics; identifying a quota thatspecifies a maximum total number of requests that have the one or morespecified characteristics that can be approved by all of a plurality ofrequest processing servers; generating a first current estimated totalnumber of requests having the one or more characteristics that have beenreceived by all of the plurality of request processing servers based atleast on an actual number of requests received by the request processingserver since a most recent synchronization with a parent server; andapproving the first received request upon determining that the quota hasnot been reached based at least on the first current estimated total.16. The non-transitory, computer-readable media of claim 15, furtherstoring additional instructions that, when executed by the one or moreprocessors, cause the one or more processors to perform additionaloperations comprising: receiving a second request having the one or morespecified characteristics; generating a second current estimated totalnumber of requests having the one or more characteristics that have beenreceived by all of the plurality of request processing servers since themost recent synchronization based at least on the actual number ofrequests received by the request processing server; and rejecting thesecond received request upon determining that the quota has been reachedbased at least on the second current estimated total.
 17. Thenon-transitory, computer-readable media of claim 15, wherein the parentserver stores a number of times all of the plurality of requestprocessing servers have received requests having the one or morecharacteristics, and wherein other request processing serverssynchronize with the parent server to provide the parent server with arespective number of times each of the other request processing serverhas received requests having the one or more characteristics.
 18. Thenon-transitory, computer-readable media of claim 15, wherein generatingthe first current estimated total number of requests is based on a fillfactor that is a ratio of a first rate at which other request processingservers are receiving requests having the one or more characteristics toa second rate at which the request processing server is receivingrequests having the one or more characteristics.
 19. The non-transitory,computer readable media of claim 15, further storing additionalinstructions that, when executed by the one or more processors, causethe processors to perform additional operations comprising: determiningwhether the fill factor is increasing or decreasing; if the fill factoris increasing, updating the fill factor according to a first function;and if the fill factor is decreasing, updating the fill factor accordingto a second function.
 20. The non-transitory, computer readable media ofclaim 15, wherein synchronization occurs more frequently as the currentestimated total number of requests approaches the quota.